<template>
  <!-- 帖子详情 -->
  <div>
    <van-nav-bar>
      <template #right>
        <van-icon name="more-o" size="20" />
      </template>
      <template #title>
        <div @click="yui()">{{ aee.typeName }}<van-icon name="arrow" size="18" class="opp"/></div>
      </template>
      <template #left>
        <van-icon name="arrow-left" size="20" @click="ts()" />
      </template>
    </van-nav-bar>
    <div>
      <h1>{{ aee.content }}</h1>
    </div>
    <div>
      <div class="all5">
        <!-- 头像 -->
        <div >
          <van-image round width="5rem" height="5rem" :src="aee.touxiang" />
        </div>
        <!-- 用户信息 -->
        <div class="infor4">
          <div>
            <span>用户名</span>
          </div>
          <div>用户地址</div>
        </div>
        <div>
          <van-button type="primary">加关注</van-button>
        </div>
      </div>
    </div>
    <div>
      <img v-for="ing in aee.picturePath" :key="ing" :src="ing" alt="">
    </div>
  </div>
</template>
<script>
let addf = '';
import axios from 'axios';
export default {
  beforeRouteEnter(to, from, next) {
    // 在渲染该组件的对应路由被 confirm 前调用
    // 不！能！获取组件实例 `this`
    // 因为当守卫执行前，组件实例还没被创建
    console.log(from);
    addf = from.fullPath;
    next();
  },
  methods: {
    ts() {
      this.$router.push({
        name:'forum'
      });
    },
    yui(){
      this.$router.push({
        name:'主祥'
      })
    }
  },
  mounted() {
    axios
      .post(
        '/api/article/getArticleByid',
        {},
        {
          params: { id: this.aoo },
        }
      )
      .then((res) => {
        console.log(res.data.data);
        this.aee = res.data.data;
        
      });
  },
  data() {
    return {
      aee: [],
      aoo: this.$route.query.po,
    };
  },
};
</script>
<style  scoped>

.all5{
  display: flex;
}
.opp{
  position: relative;
  top:0.4rem;
}
</style>